<template>
  <div class="login">
    <div class="login-header">
      <span class="cha">×</span>
      <span>帮助</span>
    </div>
    <div class="login-content">
      <div class="des">
        <h2>登录后即可展示自己，同时看到点赞、收藏的视频</h2>
        <span>登录即表明同意<a href="">抖音协议</a>和<a href="">隐私政策</a></span>
      </div>
      <div class="login-box">
        <div class="sele">
          <select class="sele-control" v-model="telErea">
            <option value="">+86</option>
          </select>
        </div>
        <div class="inp">
          <input
            v-model="phone"
            @input="changeTel"
            type="text"
            class="inp-control"
            placeholder="请输入手机号码"
          />
        </div>
      </div>
      <div class="not-login"><p>未注册手机号验证通过后将自动登录</p></div>
      <div class="code-btn">
        <button :disabled="disabled" 
        :class="disabled ? '' : 'active'"
        @click="getCode">
          获取短信验证码
        </button>
      </div>
      <div class="other">
        <router-link to="/tplogin" tag="a">密码登录</router-link>
        <span @click="showMask = !showMask">其他方式登录</span>
      </div>
    </div>
    <transition name="up">
      <div class="mask" v-if="showMask">
        <div class="else">
          <ul>
            <li class="else-item">今日头条登录</li>
            <li class="else-item">QQ登录</li>
            <li class="else-item">微信登录</li>
            <li class="else-item">微博登录</li>
            <li @click="showMask = !showMask" class="else-item cancel">取消</li>
          </ul>
        </div>
      </div>
    </transition>
  </div>
</template>
<script>
export default {
  name: "Login",
  data() {
    return {
      telErea: "",
      showMask: false,
      disabled: true,
      phone: "",
    };
  },
  methods: {
    changeTel() {
      // this.phone=e.target.value;
      console.log(window.innerHeight);
      var judge = /^1[345789]{1}\d{9}$/;
      if (judge.test(this.phone)) {
        this.disabled = false;
      } else {
        this.disabled = true;
      }
    },
    getCode(){

    }
  },
};
</script>
<style scoped>
.login {
  position: relative;
  float: left;
  padding: 30px;
  height: 667px;
}
.login-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  line-height: 30px;
}
.login-header .cha {
  font-size: 23px;
}
.login-header .icon {
  font-size: 20px;
}
.login-content {
  padding: 40px 10px;
  height: 100%;
}
.des h2 {
  font-size: 20px;
  font-weight: bold;
}
.des span {
  color: #666;
  line-height: 50px;
  font-size: 13px;
  opacity: 0.7;
}
.des span a {
  color: #0359a0;
  padding: 0 5px;
}
.login-box {
  display: flex;
  height: 44px;
  align-items: center;
  background-color: #f9f9f9;
}
.sele-control {
  background-color: #f9f9f9;
  height: 36px;
  border: none;
  font-size: 15px;
}
.inp-control {
  height: 40px;
  background-color: #f9f9f9;
  border: none;
  width: 90%;
  margin-left: 10px;
  outline: none;
  font-size: 15px;
}
input {
  caret-color: #fe2c55;
}
input::-webkit-input-placeholder {
  color: #cccccc;
}
.not-login p {
  color: #bbb;
  font-size: 13px;
  margin-top: 10px;
}
.code-btn button {
  background-color: #ccc;
  margin: 20px 0;
  width: 100%;
  padding: 12px 0;
  border: none;
  color: #fdfdfd;
}
.code-btn .active {
  background-color: #fe2c55;
}
.other {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #0359a0;
}
.other a {
  color: #0359a0;
}
a {
  text-decoration: none;
}
.mask {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.4);
}
.else {
  height: 35%;
  width: 100%;
  position: absolute;
  bottom: 0;
  border-radius: 5px;
  background-color: #fff;
  text-align: center;
}
.else-item {
  border-bottom: 1px solid #f5f5f5;
  line-height: 40px;
  font-size: 15px;
}
.up-enter-active {
  transition: all 0.5s ease;
}
.up-leave-active {
  transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}
.up-enter,
.up-leave-to {
  transform: translateY(100%);
  opacity: 1;
}
</style>
